import request from '@/utils/request'

// 创建工序节点
export function createProcessRouteProcessNode(data) {
  return request({
    url: '/basic/process-route-node/create',
    method: 'post',
    data: data
  })
}

// 更新工序节点
export function updateProcessRouteProcessNode(data) {
  return request({
    url: '/basic/process-route-node/update',
    method: 'put',
    data: data
  })
}

// 删除工序节点
export function deleteProcessRouteProcessNode(id) {
  return request({
    url: '/basic/process-route-node/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除工序节点 */
export function deleteProcessRouteProcessNodeList(ids) {
  return request({
    url: `/basic/process-route-node/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得工序节点
export function getProcessRouteProcessNode(id) {
  return request({
    url: '/basic/process-route-node/get?id=' + id,
    method: 'get'
  })
}

// 获得工序节点分页
export function getProcessRouteProcessNodePage(params) {
  return request({
    url: '/basic/process-route-node/page',
    method: 'get',
    params
  })
}
// 导出工序节点 Excel
export function exportProcessRouteProcessNodeExcel(params) {
  return request({
    url: '/basic/process-route-node/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 获得工艺路线下所有工序节点
export function getNodeAll(params) {
  return request({
    url: '/basic/process-route-node/getNodeAll',
    method: 'get',
    params
  })
}
